/**************************************************************************(C)*
 *
 *  This file is part of the GreenHills project
 *  Copyright (C) 2009  Tieto Corporation
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  Not for commmercial use. Only with Tieto permission.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************************************************************************(C)*/

#pragma once

#include "iroomitem.h"
#include "coredll.h"

namespace greenhills {
namespace core {

/** @brief Room item object
 *
 * This class represents object in a room. Each object is identified by id, and
 * has some name.
 */
class GH_CORE_CLASS CRoomItem
    : public core::IRoomItem
{
public:
    CRoomItem();
    CRoomItem(const core::CItemId &pId, const std::string &pName);

public: //IRoomItem
    virtual core::CItemId id() const {return mId;}
    virtual std::string name() const {return mName;}

    virtual bool updateItem(const unsigned char *pData, unsigned int pLength);
    virtual util::obinstream& operator<<(util::obinstream &pStream) const;
    virtual util::ibinstream& operator>>(util::ibinstream &pStream);

protected:
    virtual void setId(const core::CItemId &pId) {mId = pId;}
    virtual void setName(const std::string &pName) {mName = pName;}

private:
    core::CItemId mId;
    std::string mName;
};

} //namespace core
} //namespace greenhills
